﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Delay
{
    public class PhonePkDetailItem : INotifyPropertyChanged
    {
        private string _title;
        public string Title
        {
            get
            {
                return _title;
            }
            set
            {
                if (_title != value)
                {
                    _title = value;
                    NotifyPropertyChanged("Title");
                }
            }
        }
        private string _content;
        public string Content
        {
            get
            {
                if (_content != null && _content.Length > 0)
                {
                    return _content.Replace("<br />", "\r\n").Replace("<br/ >", "\r\n").Replace("<br/>", "\r\n");
                }
                else
                    return _content;
            }
            set
            {
                if (_content != value)
                {
                    _content = value;
                    NotifyPropertyChanged("Content");
                }
            }

        }
        //
        private string _type;
        public string Type
        {
            get
            {
                return _type;
            }
            set
            {
                if (_type != value)
                {
                    _type = value;
                    NotifyPropertyChanged("Type");
                }
            }
        }
        //
        private string _content_2;
        public string Content_2
        {
            get
            {
                if (_content_2 != null && _content_2.Length > 0)
                {
                    return _content_2.Replace("<br />", "\r\n").Replace("<br/ >", "\r\n").Replace("<br/>", "\r\n");
                }
                else
                    return _content_2;
            }
            set
            {
                if (_content_2 != value)
                {
                    _content_2 = value;
                    NotifyPropertyChanged("Content_2");
                }
            }

        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
